Use the debug render registry to register debug rendering functions for your custom Node3D nodes. More...
#include <kanzi/core.ui/node/debug_render_registry.hpp>
Classes | |
| class | DebugRenderStorage |
| Storage class for storing visualizations used with debug rendering. More... | |
Public Types | |
| using | DebugObjectRenderingFunction |
| Debug object rendering function pointer. | |
| using | FunctionMap |
| Type for the debug function map. | |
Public Member Functions | |
| void | addMapping (const Metaclass *metaclass, DebugObjectRenderingFunction function) |
| Adds a mapping from the metaclass to the function that you want to use to render the debug visualization. | |
| DebugObjectRenderingFunction | getRenderingFunction (const Metaclass *metaclass) const |
| Gets the debug rendering function of a given metaclass. | |
Protected Attributes | |
| FunctionMap | m_functionMapping |
| Function mapping. | |
Use the debug render registry to register debug rendering functions for your custom Node3D nodes.
The central registry allows the Kanzi Studio Preview and Kanzi Engine plugins to register these functions.
For your custom node type, use a debug rendering function to draw information that is helpful to you during development. For example, for the Camera node, the debug rendering function draws a wireframe visualization that displays the orientation of the camera. To see the debug visualizations in the Kanzi Studio Preview, enable the Analyze mode.
To register the debug rendering functions for your plugin module, use Module::registerDebugRenderingFunctions.
The debug rendering function is of the form:
void (*)(Renderer& renderer, DebugRenderStorage&, DebugVisualization*, NodeSharedPtr)
Here, the storage and visualization allow the user to cache data related to the debug rendering of the node. If the debug visualization is used, it must be created and added to the storage by calling DebugRenderStorage::emplace(). The user may omit using this feature, to achieve this, do not create a debug visualization (in this case, the visualization parameter will always be nullptr).
Debug object rendering function pointer.
| renderer | Renderer to use. |
| storage | Debug rendering storage. |
| visualization | Previously created debug visualization or nullptr. |
| object | Object being rendered. |
storage and visualization parameters.renderer parameter to Renderer&. Type for the debug function map.
| void kanzi::DebugRenderRegistry::addMapping | ( | const Metaclass * | metaclass, |
| DebugObjectRenderingFunction | function ) |
Adds a mapping from the metaclass to the function that you want to use to render the debug visualization.
| metaclass | Metaclass to register. |
| function | The function to use to render the debug visualization for the nodes of a given metaclass. |
| DebugObjectRenderingFunction kanzi::DebugRenderRegistry::getRenderingFunction | ( | const Metaclass * | metaclass | ) | const |
Gets the debug rendering function of a given metaclass.
| metaclass | The Metaclass for which to get the debug rendering function. |
|
protected |
Function mapping.